<html
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui">

    <ui:composition template="layout.xhtml">
        <ui:define name="title">
            Pesquisar Ato
        </ui:define>

        <ui:define name="content">           
            <h:form id="pesquisarAtoForm">
                <p:messages id="atoPesquisarMessages" autoUpdate="true" />
                <div class="actions">
                    <div id="buttons">
                        <p:button value="Cadastrar Ato" outcome="criarAto.xhtml"
                                  icon="ui-icon-plus" styleClass="ui-priority-primary">
                        </p:button>
                    </div>
                </div> 

                <p:fieldset legend="Filtros" id="dadosFieldset">
                    <f:validateBean disabled="true">
                        <div class="row">
                            <div class="column1">
                                <p:outputLabel value="Código" for="codigoInputText" />
                            </div>
                            <div class="column4">
                                <p:inputText id="codigoInputText" value="#{ managerPesquisarAto.atoPesquisar.codigo }" />
                            </div>
                            <div class="column2">
                                <p:outputLabel value="Descrição" for="descricaoInputText" />
                            </div>
                            <div class="column5">
                                <p:inputText id="descricaoInputText" value="#{ managerPesquisarAto.atoPesquisar.descricao }" />
                            </div>
                        </div>
                    </f:validateBean>
                </p:fieldset>

                <div class="command">
                    <p:commandButton
                        id="pesquisarcommandButton" value="Pesquisar" icon="ui-icon-search"
                        styleClass="ui-priority-primary"
                        update="@form" actionListener="#{ managerPesquisarAto.pesquisar() }" />
                    <p:commandButton value="Limpar" icon="ui-icon-close" update="@form" actionListener="#{ managerPesquisarAto.limpar() }" />
                </div>

                <p:dataTable id="atosDataTable" var="ato" value="#{ managerPesquisarAto.atos }"
                             rows="10" paginator="true" paginatorPosition="bottom" emptyMessage="Nenhum registro encontrado">

                    <p:column width="5%" headerText="Opções">
                        <div class="options1">

                            <p:button
                                title="Visualizar" href="visualizarAto.xhtml?atoVisualizarId=#{ ato.id }"
                                icon="ui-icon-search"/>
                        </div>
                    </p:column>

                    <p:column headerText="Código" width="10%">
                        <h:outputText value="#{ ato.codigo }" />
                    </p:column>
                    <p:column headerText="Descrição" width="80%">
                        <h:outputText value="#{ ato.descricao }" />
                    </p:column>
                </p:dataTable>

            </h:form>
        </ui:define>
    </ui:composition>

</html>